package com.liuyu.common.framework.rocketmq.strategy.service.impl;

import com.liuyu.common.framework.rocketmq.strategy.service.facade.TransactionServiceStrategy;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Service;

/**
 * 事务消息策略实现类
 *
 * @author: liuyu
 * @date: 2024/9/6 10:27
 * @version: 1
 */
@Service
public class TransactionServiceStrategyImpl implements TransactionServiceStrategy {
    /**
     * 队列类型
     *
     * @return java.lang.String
     * @author liuyu
     * @date 2022/4/10 13:09
     */
    @Override
    public String getQueueType() {
        return "default";
    }

    /**
     * 执行本地方法
     *
     * @param message
     * @param o
     * @return boolean
     * @author liuyu
     * @date 2022/4/9 21:57
     */
    @Override
    public boolean executeTransaction(Message message, Object o) {
        return false;
    }

    /**
     * 进行本地的事务校验
     *
     * @param message
     * @return boolean
     * @author liuyu
     * @date 2022/4/9 21:58
     */
    @Override
    public Integer checkTransaction(Message message) {
        return 0;
    }

    /**
     * 事务失败处理
     *
     * @param message
     * @return boolean
     * @author liuyu
     * @date 2022/4/9 21:58
     */
    @Override
    public boolean checkTransactionFail(Message message) {
        return false;
    }

    /**
     * 事务重试次数
     *
     * @return int
     * @author liuyu
     * @date 2022/4/10 13:30
     */
    @Override
    public int getMaxTryTimes() {
        return 0;
    }
}
